home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
res.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-09-26
|
3KB
|
128 lines
#include <exec/types.h>
#include <libraries/dos.h>
#include <intuition/intuition.h>
#define BIT7 (1<<7)
struct IntuitionBase *IntuitionBase;
struct JanusBase *JanusBase;
struct NewWindow nw=
{
75,75,450,10,
0,1,
CLOSEWINDOW|RAWKEY,
WINDOWCLOSE|WINDOWDEPTH|WINDOWDRAG|ACTIVATE,
NULL,NULL,"ATUtilities Rescue - Version 4.0",
NULL,NULL,
100,10,640,20,
WBENCHSCREEN
};
VOID Sendung();
UBYTE Table[256];
ULONG JanusStart;
/* Hauptprogramm */
VOID main(argc,argv)
LONG argc;
UBYTE *argv[];
{
REGISTER BOOL ende;
REGISTER ULONG Class;
REGISTER UWORD Code;
register struct FileHandle *fh;
register struct Window *win;
register struct IntuiMessage *msg;
struct Screen *scr;
IntuitionBase=OpenLibrary("intuition.library",0L);
if(IntuitionBase!=NULL)
{
scr=OpenWorkBench();
nw.Height=scr->WBorTop+scr->Font->ta_YSize+1;
win=OpenWindow(&nw);
if(win!=NULL)
{
JanusBase=OpenLibrary("janus.library",0L);
if(JanusBase!=NULL)
{
fh=Open("AT:ATKeyboard-System/Rescue.codetable",MODE_OLDFILE);
if(fh!=NULL)
{
Read(fh,&Table,256);
JanusStart=GetJanusStart();
ende=FALSE;
while(ende==FALSE)
{
WaitPort(win->UserPort);
msg=GetMsg(win->UserPort);
Class=msg->Class;
Code=msg->Code;
ReplyMsg(msg);
switch(Class)
{
case CLOSEWINDOW:
ende=TRUE;
break;
case RAWKEY:
if((Code==0x62)||(Code==(0x62+BIT7)))
{
Sendung(0xba);
Delay(5);
Sendung(0x3a);
}
else
{
Sendung(Table[(UBYTE)Code]);
}
Delay(3);
break;
}
}
Close(fh);
}
else
{
SetWindowTitles(win,"Rescue - CodeTable-Datei fehlt!",-1L);
Delay(200);
}
CloseLibrary(JanusBase);
}
else
{
SetWindowTitles(win,"Rescue - Keine Janus-Library!",-1L);
Delay(200);
}
CloseWindow(win);
}
CloseLibrary(IntuitionBase);
}
}
#asm
public _Sendung
_Sendung:
movem.l a1-a2/d7,-(sp)
move.l 16(sp),d7
move.l _JanusStart,a1
move.l a1,a2
adda.l #516096,a1
moveq.l #0,d0
move.l _JanusBase,a6
move.w 114(a6),d0
add.l d0,a1
adda.l #524283,a2
move.b d7,(a1)
move.b #-1,(a2)
movem.l (sp)+,a1-a2/d7
rts
#endasm